summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/(evcp)/docu-list-rule/document-class/page.tsx
blob: 5c2c600e3900b115a86f390a5c0633b78217a495 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import * as React from "react";
import { Shell } from "@/components/shell";
import { Skeleton } from "@/components/ui/skeleton";
import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton";
import { getDocumentClassCodeGroups } from "@/lib/docu-list-rule/document-class/service";
import { DocumentClassTable } from "@/lib/docu-list-rule/document-class/table/document-class-table";
import { InformationButton } from "@/components/information/information-button";
import { searchParamsDocumentClassCache } from "@/lib/docu-list-rule/document-class/validation";

interface IndexPageProps {
  searchParams: Promise<any>;
}

export default async function IndexPage(props: IndexPageProps) {
  const searchParams = await props.searchParams;

  const promises = Promise.all([
    getDocumentClassCodeGroups(
      searchParamsDocumentClassCache.parse(searchParams)
    ),
  ]);

  return (
    <Shell className="gap-2">
      <div className="flex items-center justify-between space-y-2">
        <div>
          <div className="flex items-center gap-2">
            <h2 className="text-2xl font-bold tracking-tight">Document Class 관리</h2>
            <InformationButton pagePath="evcp/docu-list-rule/document-class" />
          </div>
          {/* <p className="text-muted-foreground">
            Document Class를 관리합니다.
          </p> */}
        </div>
      </div>
      <React.Suspense fallback={<Skeleton className="h-7 w-52" />}></React.Suspense>
      <React.Suspense
        fallback={
          <DataTableSkeleton
            columnCount={4}
            searchableColumnCount={1}
            filterableColumnCount={1}
            cellWidths={["10rem", "20rem", "10rem", "8rem"]}
            shrinkZero
          />
        }
      >
        <DocumentClassTable promises={promises} />
      </React.Suspense>
    </Shell>
  );
}